

import 'package:flutter_shark_im/entity/message/base_message_entity.dart';

class UserListResponseEntity {
	int result;
	int responseNo;
	int no;
	String createTime;
	int id = BaseMessageEntity.GET_USER_LIST_RESPONSE;
	List<User> users;

	UserListResponseEntity({this.result, this.responseNo, this.no, this.createTime, this.users});

	UserListResponseEntity.fromJson(Map<String, dynamic> json) {
		result = json['result'];
		responseNo = json['responseNo'];
		no = json['no'];
		createTime = json['createTime'];
		id = json['id'];
		if (json['users'] != null) {
			users = new List<User>();(json['users'] as List).forEach((v) { users.add(new User.fromJson(v)); });
		}
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['result'] = this.result;
		data['responseNo'] = this.responseNo;
		data['no'] = this.no;
		data['createTime'] = this.createTime;
		data['id'] = this.id;
		if (this.users != null) {
      data['users'] =  this.users.map((v) => v.toJson()).toList();
    }
		return data;
	}
}

class User {
	String name;
	String id;
	String avatar;
	int status;

	User({this.name, this.id, this.avatar, this.status});

	User.fromJson(Map<String, dynamic> json) {
		name = json['name'];
		id = json['id'];
		avatar = json['avatar'];
		status = json['status'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['name'] = this.name;
		data['id'] = this.id;
		data['avatar'] = this.avatar;
		data['status'] = this.status;
		return data;
	}
}
